package lab02.test18;


 public class Test18 {

    public static void main(String[] args) {

            String name="My name is Network crazy";

             System.out.println("字符串长度为:"+name.length());

               System.out.println("字符串的第一个字符:"+name.charAt(0));

                System.out.println("字符串的最后一个字符:"+name.charAt(name.length()-1));

                String[] result=name.split(" ");//用空格分割字符串，之后放在一个数组中

                System.out.println("第一个单词为:"+result[0]);

                System.out.println("crazy位置在:第"+(name.indexOf("crazy")+1)+"个");

           }

}
